<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Email</title>
</head>
<body>
  <h1>Email Content</h1>
  <p id="email-content">This is the content of the email.</p>
  <button onclick="goBack()">Back to Inbox</button>
  <script>
    function goBack() {
      window.electron.navigate('inbox');
    }
    const emailId = localStorage.getItem('emailId');
    if (emailId) {
      window.electronAPI.send('set-email', emailId);
      window.electronAPI.receive('get-email', (email) => {
        console.log(email)
        document.getElementById('email-content').textContent = email.content;
      });
    }
  </script>
</body>
</html>
